//
// Created by liuml on 2018/10/22.
//

#ifndef XYMUSIC_XYQUEUE_H
#define XYMUSIC_XYQUEUE_H

#include "queue"
#include "pthread.h"
#include "AndroidLog.h"
#include "XYPlayStatus.h"

extern "C" {
#include "libavcodec/avcodec.h"
};

class XYQueue {

public:
    std::queue<AVPacket *> queuePacket;
    pthread_mutex_t mutexPacket;//用于
    pthread_cond_t condPacket;
    XYPlayStatus *playStatus = NULL;

public:
    XYQueue(XYPlayStatus *playStatus);
    ~XYQueue();

    int putAvpacket(AVPacket *packet);

    int getAvpacket(AVPacket *packet);

    int getQueueSize();

    void clearAvpacket();
};

#endif //XYMUSIC_XYQUEUE_H
